<?php


namespace app\utils;


class DateTime
{
    public function setTime($time){
        if ($time != null)$time = strtotime($time);
        return $time;
    }

    public function getTime($time , $format = 'Y-m-d H:i:s'){
        if ($time != null)$time = date($format , $time);
        return $time;
    }

    public function getDay($start_time , $end_time){
        return ceil(abs($this->setTime($end_time) - $this->setTime($start_time)) / (60*60*24));
    }
}